package cn.yuanqiao.archive.storeRoom.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 档案盒记录对象 BJYQ_YQBOX_RECORD
 * 
 * @author xy
 * @date 2023-07-08
 */
public class BoxRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;


    private final String BIGTABLENAME = "_YQBOX_RECORD";

    public BoxRecord() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            //throw new ServiceException("tenantCode is null");
            this.tableName="YQBOX_RECORD";
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }

    /** id */
    @IdAnnotation
    private Long id;

    /** 盒子规格Id */
    @Excel(name = "盒子规格Id")
    private Long specId;

    /** 制作时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "制作时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date productiveTime;


    private Date edProductiveTime;


    /** 备注 */
    @Excel(name = "备注")
    private String notes;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long creator;


    private String createUser;

    /** 是否删除 */
    @Excel(name = "是否删除")
    private Integer isDel;

    /** 盒子数 */
    @Excel(name = "盒子数")
    private Integer boxNum;

    private String tableName;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setSpecId(Long specId) 
    {
        this.specId = specId;
    }

    public Long getSpecId() 
    {
        return specId;
    }
    public void setProductiveTime(Date productiveTime) 
    {
        this.productiveTime = productiveTime;
    }

    public Date getProductiveTime() 
    {
        return productiveTime;
    }
    public void setNotes(String notes) 
    {
        this.notes = notes;
    }

    public String getNotes() 
    {
        return notes;
    }
    public void setCreator(Long creator) 
    {
        this.creator = creator;
    }

    public Long getCreator() 
    {
        return creator;
    }
    public void setIsDel(Integer isDel) 
    {
        this.isDel = isDel;
    }

    public Integer getIsDel() 
    {
        return isDel;
    }
    public void setBoxNum(Integer boxNum) 
    {
        this.boxNum = boxNum;
    }

    public Integer getBoxNum() 
    {
        return boxNum;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Date getEdProductiveTime() {
        return edProductiveTime;
    }

    public void setEdProductiveTime(Date edProductiveTime) {
        this.edProductiveTime = edProductiveTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("specId", getSpecId())
            .append("productiveTime", getProductiveTime())
            .append("notes", getNotes())
            .append("createTime", getCreateTime())
            .append("creator", getCreator())
            .append("isDel", getIsDel())
            .append("boxNum", getBoxNum())
            .toString();
    }
}
